package com.yugao.fintech.libra.stat.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.stereotype.Service;

@Service
@ConditionalOnClass({FeignAutoConfiguration.class, NacosServiceAutoConfiguration.class})
public class StatFacadeApiCloudImpl implements StatFacadeApi {
    @Autowired
    private RemoteStatisticService service;

    @Override
    public void statAccessTask() {
        Resp<?> rs = service.statAccessTask();
        RetOps.of(rs).assertSuccess(e -> new BusinessException(e.getCode(), e.getMsg()));
    }

    @Override
    public void statLoginTask() {
        Resp<?> rs = service.statLoginTask();
        RetOps.of(rs).assertSuccess(e -> new BusinessException(e.getCode(), e.getMsg()));
    }
}
